$('.content2-item ').hover(function () {
    $(this).children('img').animate({marginTop: '-8px'}, 200)
    $(this).children('img').css('box-shadow', '0px 0px 30px #e8e8e8');

}, function () {
    $(this).children('img').css('box-shadow', 'none');
    $(this).children('img').animate({marginTop: '0px'}, 200)
})

var wheight = $(window).height()
var total_heiht = document.body.scrollTop + wheight;
if (total_heiht > 1040) {
    $('.content2-item').addClass('am-animation-fade')
}
if (total_heiht > 1570) {
    $('.content3-img').addClass('am-animation-slide-left')
    $('.content3-text > .c-747474').addClass('am-animation-slide-right')
}
if (total_heiht > 2314) {
    $('.content4-con').addClass('am-animation-scale-up')
    $('.content4-img').addClass('am-animation-scale-down')
}
if (total_heiht > 2921) {
    $('.content5-img').addClass('am-animation-fade')
}
window.onscroll = function () {
    var total_heiht = document.body.scrollTop + wheight;
    if (total_heiht > 1040) {
        $('.content2-item').addClass('am-animation-fade')
    }
    if (total_heiht > 1570) {
        $('.content3-img').addClass('am-animation-slide-left')
        $('.content3-text > .c-747474').addClass('am-animation-slide-right')
    }
    if (total_heiht > 2314) {
        $('.content4-con').addClass('am-animation-scale-up')
        $('.content4-img').addClass('am-animation-scale-down')
    }
    if (total_heiht > 2921) {
        $('.content5-img').addClass('am-animation-fade')
    }
    if (document.body.scrollTop == 0) {
        $('.nav-bar').css('background-color', '#fff')
        $('.nav-bar *').css('color', '#000')
    }
    else {
        $('.nav-bar').css('background-color', 'rgba(0,0,0,0.8)')
        $('.nav-bar *').css('color', '#fff')
    }
}


var map = new BMap.Map("container");
var point = new BMap.Point(119.33197, 26.146169);
map.centerAndZoom(point, 21);
window.setTimeout(function () {
    map.panTo(new BMap.Point(119.33197, 26.146169));
}, 2000);
var marker = new BMap.Marker(point);  // 创建标注
map.addOverlay(marker);               // 将标注添加到地图中
marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
//    map.enableScrollWheelZoom();    //启用滚轮放大缩小，默认禁用
map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
var top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT});// 左上角，添加比例尺
var top_left_navigation = new BMap.NavigationControl();  //左上角，添加默认缩放平移控件
var top_right_navigation = new BMap.NavigationControl({
    anchor: BMAP_ANCHOR_TOP_RIGHT,
    type: BMAP_NAVIGATION_CONTROL_SMALL
}); //右上角，仅包含平移和缩放按钮
map.addControl(top_left_control);
map.addControl(top_left_navigation);
map.addControl(top_right_navigation);


var t_wid = $(window).width();
$('.nav-bar').css('width', t_wid)
document.getElementById("mycanvas").width = t_wid;
document.getElementById("mycanvas2").width = t_wid;
document.getElementById("mycanvas3").width = t_wid;
document.getElementById("mycanvas4").width = t_wid;
$('.shape-1').css('border-right-width', t_wid * 0.3);
$('.shape-2').css('left', t_wid * 0.3);
$('.shape-2').css('border-left-width', t_wid * 0.7);
$('#demo-slider-0').flexslider({
    directionNav: false
})
var can = document.getElementById('mycanvas')
var can2 = document.getElementById('mycanvas2')
var can3 = document.getElementById('mycanvas3')
var can4 = document.getElementById('mycanvas4')
var ctx = can.getContext('2d')
var ctx2 = can2.getContext('2d')
var ctx3 = can3.getContext('2d')
var ctx4 = can4.getContext('2d')
var draw = function (x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, color, type, ctxtype) {
    ctxtype.beginPath();
    ctxtype.moveTo(x1, y1);
    ctxtype.lineTo(x2, y2);
    ctxtype.lineTo(x3, y3);
    ctxtype.lineTo(x4, y4);
    ctxtype.lineTo(x5, y5);
    ctxtype[type + 'Style'] = color;
    ctxtype.closePath();
    ctxtype[type]();
}
var draw2 = function (x1, y1, x2, y2, x3, y3, color, type, ctxtype) {
    ctxtype.beginPath();
    ctxtype.moveTo(x1, y1);
    ctxtype.lineTo(x2, y2);
    ctxtype.lineTo(x3, y3);

    ctxtype[type + 'Style'] = color;
    ctxtype.closePath();
    ctxtype[type]();
}
draw(0, 50, t_wid * 0.3, 150, t_wid, 0, t_wid, 150, 0, 150, 'white', 'fill', ctx);
draw(0, 0, t_wid, 0, t_wid, 130, t_wid * 0.7, 0, 0, 180, 'white', 'fill', ctx4);
draw2(0, 0, t_wid, 0, 0, 180, 'white', 'fill', ctx2);
draw2(0, 0, t_wid, 0, 0, 180, '#F3F3F3', 'fill', ctx3);